import {createBrowserRouter} from 'react-router-dom'

import App from '../App'
import Home from '../pages/home/Index'
import Index from '../pages/index/Index'
// import Ment from '../pages/ment/Index'
import Ment from '../pages/ment/Index'
import Login from '../pages/login/Index'
import Settings from '../pages/settings/Index'
import ProtectedRoute from '../components/ProtectedRoute'
import Message from '../pages/message/Index'
import Search from '../pages/search/Index'
import Zc from '../pages/zc/Index'
import Details from '../pages/details/Index'
import Yapp from '../pages/yapp/Index'
import Address from '../pages/address/Index'
import AddAddress from '../pages/address/AddAddress'
import Concern from '../pages/concern/Index'
import Health from '../pages/health/Index'
import Archive from '../pages/archive/Index'
import Messages from '../pages/message/Index'

const router=[
    {
        path:'/',
        element:<App></App>,
        children:[
            {
                index:true,
                element:<ProtectedRoute><Home></Home></ProtectedRoute>
            },
            {
                path:'home',
                element:<ProtectedRoute><Home></Home></ProtectedRoute>
            },
            {
                path:'index',
                element:<ProtectedRoute><Index></Index></ProtectedRoute>
            },
            {
                path:'ment',
                element:<ProtectedRoute><Ment></Ment></ProtectedRoute>
            },
            {
                path:'zc',
                element:<ProtectedRoute><Zc></Zc></ProtectedRoute>
            },
            
            
        ]
    },
    {
        path:'search',
        element:<ProtectedRoute><Search></Search></ProtectedRoute>
    },
    {
        path:'settings',
        element:<ProtectedRoute><Settings></Settings></ProtectedRoute>
    },
    {
        path:'login',
        element:<Login></Login>
    },
    {
        path:'message',
        element:<ProtectedRoute><Message></Message></ProtectedRoute>
    },
    {
        path:'details',
        element:<ProtectedRoute><Details></Details></ProtectedRoute>
    },
    {
        path:'yapp',
        element:<ProtectedRoute><Yapp></Yapp></ProtectedRoute> 
    },
    {
        path:'address',
        element:<ProtectedRoute><Address></Address></ProtectedRoute>
    },
    {
        path:'address/add',
        element:<ProtectedRoute><AddAddress></AddAddress></ProtectedRoute>
    },
    {
        path:'concern',
        element:<ProtectedRoute><Concern></Concern></ProtectedRoute>
    },
    {
        path:'health',
        element:<ProtectedRoute><Health></Health></ProtectedRoute>
    },
    {
        path:'archive',
        element:<ProtectedRoute><Archive></Archive></ProtectedRoute>
    },
    {
        path:'messages',
        element:<ProtectedRoute><Messages></Messages></ProtectedRoute>
    },
    {
                path:'/*',
                element:<h1>404</h1>
    }
]

export default createBrowserRouter(router);